//
//  KZMistakesCoachingHeaderView.m
//  lg_zhinengbeikao_english
//
//  Created by 朱凯 on 2018/12/20.
//  Copyright © 2018年 zhukai. All rights reserved.
//

#import "KZMistakesCoachingHeaderView.h"

// view
#import "KZWaveCountView.h"


@implementation KZMistakesCoachingHeaderView
{
    UIImageView *_bgView;
    

    KZWaveCountView *_waveCountView;
}

#pragma mark - 初始化
- (instancetype)initWithFrame:(CGRect)frame {
    if (self = [super initWithFrame:frame]) {
        [self setupUI];
    }
    return self;
}
#pragma mark - 创建视图
- (void)setupUI {
    
    _bgView = [UIImageView new];
    _bgView.image = [UIImage imageWithColor:kBlueColor];
    [self addSubview:_bgView];
    [_bgView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.edges.equalTo(self);
    }];
    
    _waveCountView = [KZWaveCountView new];
    [self addSubview:_waveCountView];
    [_waveCountView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.center.equalTo(self);
        make.width.height.mas_equalTo(100);
    }];
}

#pragma mark - setter
- (void)setOffset:(CGFloat)offset {
    
    _offset = offset;
    NSLog(@"%lf", _offset);
    [_bgView mas_updateConstraints:^(MASConstraintMaker *make) {
        make.top.mas_equalTo(offset);
    }];
}
@end
